import Users
import ctypes
import random
import time

# 防止系统休眠
def prevent_sleep():
    ES_CONTINUOUS = 0x80000000
    ES_SYSTEM_REQUIRED = 0x00000001
    ctypes.windll.kernel32.SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED)

# 停止防止休眠
def allow_sleep():
    ES_CONTINUOUS = 0x80000000
    ctypes.windll.kernel32.SetThreadExecutionState(ES_CONTINUOUS)

# 在需要防止休眠的部分调用 prevent_sleep()
prevent_sleep() 



def random_delay():
    print("Randomly selecting running time, please wait")
    delay = random.uniform(60, 5400)  # 生成一个60到7200之间的随机数（单位：秒）
    time.sleep(delay)

random_delay()


# lfk=Users.User("2208170211")
# lfk.login("_LSA-AN00")
# lfk.run()

ccr=Users.User("2208170203")
ccr.login("_22011211C_Android_13")
ccr.run()

# lkx=Users.User("2206030211")
# lkx.login("_22021211C_Android_13")
# lkx.run()

# hbr=Users.User("2206030111")
# hbr.login("_22021211C_Android_13")
# hbr.run()

# hl=Users.User("2206040106")
# hl.login("_FNE-AN00_Android_12")
# hl.run()

# lxy=Users.User("2207020109")
# lxy.login("_V2171A_Android_13")
# lxy.run()
random_delay()
lyx=Users.User("2208170210")
lyx.login("_SM-G9730_Android_10")
lyx.run()

# lj=Users.User("2208170213")
# lj.login("_NCO-AL00_Android_12")
# lj.run()
        
# lgh=Users.User("2208170108")
# lgh.login("_NAM-AL00_Android_12")
# lgh.run()

# wh=Users.User("2208030122")
# wh.login("_V2190A_Android_12")
# wh.run()

# fyc=Users.User("2208170406")
# fyc.login("_GIA-AN00_Android_12")
# fyc.run()

# ljdx=Users.User("2210010310")
# ljdx.login("_NCO-AL00_Android_12")
# ljdx.run()

# gt=Users.User("2208010408")
# gt.login("_NCO-AL00_Android_12")
# gt.run()
random_delay()
yjy = Users.User("2209030228")
yjy.login("_ANY-AN00_Android_12")
yjy.run()

allow_sleep()
